<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 设置视口标签 -->
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,maximum-scale=1.0">
    <title>Document</title>
    <!-- 引入初始化样式 -->
    <link rel="stylesheet" href="./css/normalize.css">
    <!-- 引入首页的css -->
    <link rel="stylesheet" href="./css/index.css">
</head>

<body>
    <!-- 顶部 -->
    <header class="app">
        <ul>
            <li>
                <img src="./images/close.png" alt="">
            </li>
            <li>
                <img src="./images/logo.png" alt="">
            </li>
            <li>打开京东App，购物更轻松</li>
            <li>立即打开</li>
        </ul>
    </header>
    <!-- 搜索 -->
    <div class="search-wrap">
        <div class="search-btn"></div>
        <div class="search">
            <div class="jd-icon"></div>
            <div class="sou"></div>
        </div>
        <div class="search-login">登录</div>
    </div>
    <!-- 主体内容部分 -->
    <div class="mainContent">
        <!-- 滑动图 -->
        <div class="slider">
            <img src="./upload/banner.dpg" alt="">
        </div>
        <!-- 品牌日 -->
        <div class="brand">
            <div>
                <a href="#">
                    <img src="./upload/pic11.dpg" alt="">
                </a>
            </div>
            <div>
                <a href="#">
                    <img src="./upload/pic22.dpg" alt="">
                </a>
            </div>
            <div>
                <a href="#">
                    <img src="./upload/pic33.dpg" alt="">
                </a>
            </div>
        </div>
        <!-- nav部分 -->
        <nav class="clearfix">
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            <a href="#">
                <img src="./upload/nav1.webp" alt="">
                <span>京东超市</span>
            </a>
            
        </nav>
        <!-- 新闻快报模块 -->
        <div class="news">
            <a href="#">
                <img src="./upload/new1.dpg" alt="">
            </a>
            <a href="#">
                <img src="./upload/new2.dpg" alt="">
            </a>
            <a href="#">
                <img src="./upload/new3.dpg" alt="">
            </a>
        </div>

    </div>
    <script>
        class LazyManClass {
            constructor(name) {
                console.log(`I am ${name}`)
                this._funs = []
                setTimeout(() => {
                    this.next()
                })

            }
            sleepFirst(time) {
                let fn = () => {
                    setTimeout(() => {
                        console.log(`sleep ${time}`)
                        this.next()
                    }, time)
                }
                this._funs.unshift(fn)
                return this
            }
            sleep(time) {
                let fn = () => {
                    setTimeout(() => {
                        console.log(`sleep ${time}`)
                        this.next()
                    }, time)
                }
                this._funs.push(fn)
                return this
            }
            eat(food) {
                let fn = () => {
                    console.log(`eat ${food}`)
                    this.next()
                }
                this._funs.push(fn)
                console.log(this)
                return this
            }
            next() {
                let fn = this._funs.shift()
                fn && fn()
            }
        }
        
        function LazyMan(name) {
            return new LazyManClass(name)
        }
        let oneStep = LazyMan('tony')
        let twoStep = oneStep.sleep(500)
        twoStep.eat('lunch')
    </script>
</body>

</html>